<html>
<head><meta charset="utf-8"><title>Creating new unit tests · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html">Creating new unit tests</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232342993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20new%20unit%20tests/near/232342993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kwj2104 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html#232342993">(Mar 29 2021 at 22:00)</a>:</h4>
<p>I'm trying to learn the basics of adding new unit tests for bug fixes and trying to get a <a href="https://github.com/kwj2104/rust/blob/issue-81508-fix/src/test/ui/resolve/issue-81508.rs">small test</a> to pass but for some reason despite the .stderr file exactly matching the error output, my test fails, and I'm having trouble figuring out why. Is there something obvious I'm missing, like a specific header needs to be added? See <a href="https://pastebin.com/0V34V8tT">output</a> here.</p>
<p>Thanks!</p>



<a name="232344489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20new%20unit%20tests/near/232344489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html#232344489">(Mar 29 2021 at 22:14)</a>:</h4>
<p>don't have time to look at the output right now, but there's documentation in <a href="https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui">https://rustc-dev-guide.rust-lang.org/tests/adding.html#ui</a></p>



<a name="232345231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20new%20unit%20tests/near/232345231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kwj2104 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html#232345231">(Mar 29 2021 at 22:22)</a>:</h4>
<p>Yep I read through it. I'll give it another read but I didn't see anything stick out to me as a header that I needed. My understanding is by default the tests do not compile so no need to add any headers. Perhaps the error annotation is not correct and I need it to match a specific format?</p>



<a name="232345348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20new%20unit%20tests/near/232345348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html#232345348">(Mar 29 2021 at 22:24)</a>:</h4>
<p>Most likely due to extra space in between <code>//</code> and <code>~</code>.</p>



<a name="232346700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20new%20unit%20tests/near/232346700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kwj2104 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20new.20unit.20tests.html#232346700">(Mar 29 2021 at 22:39)</a>:</h4>
<p>Ah yes that was it. Thank you so much!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>